package com.bosssoft.setp.model.business.device;

import com.bosssoft.setp.handler.ChoiseFetchHandlerImpl;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_erupt.Power;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.Readonly;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.jpa.model.BaseModel;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 设备实体的类定义
 *
 * @author clt
 */
@Entity
@Table(name = "setp_device")
@Erupt(name = "设备管理",
        power = @Power(add = false, delete = true,
                edit = true, query = true,
                importable = false, export = false)
)
public class Device extends BaseModel {

    @EruptField(
            views = @View(title = "手机号码"),
            edit = @Edit(title = "手机号码",readonly  = @Readonly)
    )
    private String mobileTel;

    @EruptField(
            views = @View(title = "设备号"),
            edit = @Edit(title = "设备号",readonly  = @Readonly)
    )
    private String deviceNo;

    @EruptField(
            views = @View(title = "设备类型", sortable = true),
            edit = @Edit(title = "设备类型",readonly  = @Readonly)
    )
    private String type;

    @EruptField(
            views = @View(title = "操作系统", sortable = true),
            edit = @Edit(title = "操作系统",readonly  = @Readonly)
    )
    private String os;

    @EruptField(
            views = @View(title = "浏览器", sortable = true),
            edit = @Edit(title = "浏览器",readonly  = @Readonly)
    )
    private String explorer;

    @EruptField(
            views = @View(title = "状态"),
            edit = @Edit(
                    search = @Search,
                    title = "状态",
                    type = EditType.CHOICE,
                    choiceType = @ChoiceType(
                            fetchHandler = ChoiseFetchHandlerImpl.class,
                            fetchHandlerParams = {"设备审核状态"}
                    ))
    )
    private String status;
}